package com.observer;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author: sun.hongliang
 * @create: 2019/10/18 12:24
 */
public class AccountMain {
    private ExecutorService pool = null;

    public void start() {
        pool = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 10; j++) {
                ServiceThread st = new ServiceThread(i, j);
                st.addObserver(new PaddingDBObserver());
                pool.execute(st);
            }
        }
        pool.shutdown();
    }

    public static void main(String[] args) {
        AccountMain am = new AccountMain();
        am.start();
    }
}
